#ifndef XINFOMATCONFIGMANAGER_H
#define XINFOMATCONFIGMANAGER_H

/**
 *@brief:   responsibilities:
 *              (1) receive datagram
 *              (2) patch datagram
 *              (3) receive data from sub object
 *              (4) send out data
 *Notes:    the program will be called many many many times
 *				-- must be collect memory after usedi
 *				-- improve: to make it as singleton
 */
#include <qobject.h>
#include "infomatconfigdefine.h"
#include "xinfomatheadparser.h"

class XInfomatTypeParserBase;
class QUdpSocket;

class XInfomatConfigManager: public QObject
{
	Q_OBJECT

public:
    XInfomatConfigManager();
    ~XInfomatConfigManager();

    void assignJobs(void);
    void getInDatagram(QByteArray in_datagram, QString in_senderIp);
    void createTypeParser(void);

private:
    QByteArray	m_inData;
    int			m_inDataSize;
    QByteArray	m_outData;
    QString		m_outHost;
	quint16		m_outPort;
    XInfomatTypeParserBase *m_xTypeParser;  
    XInfomatHeadParser		m_xinfomatHeadParser;

public slots:
    void slotOutDatagram();
};

#endif // XINFOMATCONFIGMANAGER_H
